#逢7过
num = 100
for i in range(1,num + 1):
    if i%7 == 0 or (i%7!=0 and str(i).count('7')>0):
        print(i,end=' ')